#ifndef __YHM_NET_H__
#define __YHM_NET_H__

#include "types.h"
#include "tools.h"
#include <infiniband/verbs.h>

#define CQ_DEPTH 128
#define MAX_SGE_SIZE 4
#define PSN 101
#define MR_PERMISSION                                                  \
  (IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE | IBV_ACCESS_REMOTE_READ | \
   IBV_ACCESS_REMOTE_ATOMIC)

void server_conn_init(struct server_ctx *ctx);
void sync_server_mr(struct server_ctx *ctx);
void sync_server_hash(struct server_ctx *ctx);
void get_qp_info(struct mc_ctx *mi, const char *prefix, int rmt_id, int loc_id, struct qp_info *info);
void connect_qp(int ib_port ,struct ibv_qp *qp, struct qp_info *info);

#endif